/****

    activequant - activestocks.eu

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

	
	contact  : contact@activestocks.eu
    homepage : http://www.activestocks.eu

 ****/
package org.activequant.calendar;

import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;

import org.activequant.core.types.TimeStamp;

/**
 * An interface for a holiday calendar. <br/>
 * An interface. Defines the following methods:
 * <ul>
 * <li>TimeZone getTimeZone()</li>
 * <li>List&lt;HolidayCalendarEntry&gt; getHolidays()</li>
 * <li>boolean isHoliday(final TimeStamp when)</li>
 * <li>boolean isHoliday(final Calendar when)</li>
 * <li>boolean isOnSameDay(TimeStamp when)</li>
 * <li>HolidayCalendarEntry getHoliday(TimeStamp day)</li>
 * <li>HolidayCalendarEntry getHoliday(Calendar day)</li>
 * </ul>
 * <b>History:</b><br>
 * - [May 31, 2008] Created (mark)<br>
 * 
 * @author mark
 */
public interface IHolidayCalendar {
	/**
	 * Get the time zone for this holiday calendar
	 * 
	 * @return the time zone for this holiday calendar
	 */
	TimeZone getTimeZone();

	/**
	 * Get the holiday calendar entries from this calendar
	 * 
	 * @return a list with all holiday calendar entries
	 */
	List<HolidayCalendarEntry> getHolidays();

	/**
	 * Determines if a time stamp is during a holiday
	 * 
	 * @param when
	 *            the time stamp to check if it's during a holiday
	 * @return true if time stamp is on a holiday, otherwise false
	 */
	boolean isHoliday(final TimeStamp when);

	/**
	 * Determines if a calendar date and time is during a holiday
	 * 
	 * @param when
	 *            the calendar date and time to check if it's on a holiday
	 * @return true if the calendar date and time is on a holiday, otherwise false
	 */
	boolean isHoliday(final Calendar when);

	/**
	 * Determines if a time stamp is on the same day as the holiday.
	 * 
	 * @param when
	 *            the time stamp of which the day part is checked if it's on the same day as a holiday.
	 * @return true if the tie stamp is on the same day, otherwise false.
	 */
	boolean isOnSameDay(TimeStamp when);

	/**
	 * Gets the holiday that is on the same day as the day part of a time stamp.
	 * 
	 * @param day
	 *            the time stamp to get the holiday for.
	 * @return the holiday calendar entry or <code>null</code> if no holiday found on that day.
	 */
	HolidayCalendarEntry getHoliday(TimeStamp day);

	/**
	 * Gets the holiday that is on the same day as the day part of a calendar.
	 * 
	 * @param day
	 *            the calendar to get the holiday for.
	 * @return the holiday calendar entry or <code>null</code> if no holiday found on that day.
	 */
	HolidayCalendarEntry getHoliday(Calendar day);
}
